<template>
  <div class="markr">
    <div class="header">
      <div class="router">
        <div class="route" v-for="(item,index) in routeList" :key="index">
          <div class="router-view" @click="toPath($event,item.url)" v-if="index === 0">
            <img class="back" id="back" src="../../assets/zhome/back.png" alt />
            <span class="border"></span>
            <img class="back" src="../../assets/zhome/home.png" alt />
            <span class="title">{{ item.title }}</span>
          </div>
          <div class="router-next" @click="toPath($event,item.url)" v-else>
            <span class="bor" :class="index !== routeList.length - 1 ? 'gey':''"></span>
            <span class="title">{{ item.title }}</span>
          </div>
          <img
            v-if="index !== routeList.length - 1"
            class="icon-right"
            src="../../assets/zhome/right.png"
            alt
          />
        </div>
      </div>
      <div class="more">
        <img src="../../assets/zhome/more.png" alt />商标工具
      </div>
    </div>
    <div class="markr-cont">
      <div class="head">
        <div class="mul">
          <img src="../../assets/zhome/mul.png" alt />商品分类表
        </div>
        <div class="saerch">
          <span
            :class="searchIndex === index ? 'select-span':''"
            v-for="(item,index) in search"
            :key="index"
            @click="searchIndex = index"
          >{{ item.title }}</span>
        </div>
        <div class="ipt">
          <span class="h11">中国</span>
          <img src="@/assets/zy/three.png" alt srcset />
          <el-input style="flex: 1" v-model="input" placeholder="请输入商标名称、申请号或申请人名称" />
          <div class="btn" @click="toUrl('/trademark/trademarkdetails')">立即搜索</div>
        </div>
        <div class="crad">
          <div
            class="crad-view"
            :class="cradIndex === index ? 'select' : ''"
            v-for="(item,index) in crad"
            :key="index"
            @click="cradIndex = index"
          >
            <div class="pos">立即体验</div>
            <div class="left">
              <img v-if="index===0" src="@/assets/zhome/0.png" alt />
              <img v-else src="@/assets/zhome/1.png" alt />
              <div class="name">
                <div>{{ item.title }}</div>
                <div>{{ item.tips }}</div>
              </div>
            </div>
            <div class="right z_flex">
              <img v-if="cradIndex !== index" src="@/assets/zhome/right.png" alt />
              <img v-else src="@/assets/zhome/wright.png" alt />
            </div>
          </div>
        </div>
      </div>
    </div>

    <div class="form">
      <div class="form-div" v-for="(item,index) in formList" :key="index">
        <div class="t1">{{ item.title }}</div>
        <div class="ipt flex_1" style="height: 36px" v-if="item.place">
          <el-input v-model="item.value" :placeholder="item.place" />
        </div>
        <div class="z_flex flex_1" v-if="item.child">
          <div class="divs flex_1">
            <el-checkbox
              v-for="(a,b) in item.child"
              :key="b"
              v-model="a.check"
              :label="a.name"
              size="large"
            />
          </div>
          <div class="open" v-if="index === 0">
            <div class="pos1">
              <div class="pos1-title">搜索</div>
              <div class="pos1-list">
                <div class="views">
                  <img src="../../assets/zhome/b0.png" alt />高级检索
                </div>
                <div class="views">
                  <img src="../../assets/zhome/b1.png" alt />图像检索
                </div>
              </div>
              <div class="pos1-title">功能</div>
              <div class="pos1-list">
                <div class="views">
                  <img src="../../assets/zhome/b2.png" alt />商标监测
                </div>
              </div>
              <div class="pos1-title">管理</div>
              <div class="pos1-list">
                <div class="views">
                  <img src="../../assets/zhome/b3.png" alt />导出记录
                </div>
              </div>
            </div>
            <span style="padding-right: 5px">展开</span>
            <el-icon size="18">
              <ArrowDown />
            </el-icon>
          </div>
        </div>
      </div>

      <div class="form-more">
        展开更多筛选
        <el-icon style="margin-left:3px" size="14">
          <ArrowDown />
        </el-icon>
      </div>
    </div>

    <!-- 搜索结果 -->
    <div class="result">
      <div class="result-header">
        <span class="num1 flex_1">共查询到10000+条数据</span>
        <span class="sort">相关性(低>高)</span>
        <img src="../../assets/zhome/sort.png" alt />
        <div class="btn z_flex">导出结果列表</div>
      </div>
      <div class="result-select">
        <el-checkbox v-model="checked1" label="全选本页" size="large" />
      </div>
      <div class="result-list">
        <div
          class="lists"
          @click="toUrl(`/trademark/trademarkdetails`)"
          v-for="(item,index) in 3"
          :key="index"
        >
          <div class="image"></div>
          <div class="lists-right">
            <div class="title">
              数据仓库中创建立方模型的方法设备及存储设备
              <span>教育</span>
            </div>
            <div class="conts">
              <div class="conts_flex">
                <div style="width: 260px">申请号：CN201710877125.6</div>
                <div style="width: 260px">国际分类：24类 互联网类</div>
                <div>受理局：中国 (CN)</div>
              </div>
              <div class="conts_flex">
                <div style="width: 260px">申请日期：2017-09-25</div>
                <div style="width: 260px">初审日期：2017-09-25</div>
                <div>注册日期：2018-01-16</div>
              </div>
              <div class="conts_flex">
                <div style="width: 260px">申请人：湖南中创智慧科技有限公司</div>
                <div>代理机构：湖南省新华专利商标代理有限公司</div>
              </div>
              <div class="conts_flex">
                <div
                  class="flex_1 ellipsis"
                >商品/服务列表:软件开发 互联网服务 软件开发 互联网服务 软件开发 互联网服务 软件开发 互联网服务软件开发 互联网服务 软件开发 互联网服务互联网服务软件开发 互联网服务开…</div>
                <div class="open">
                  <span style="padding-right: 5px">展开</span>
                  <el-icon size="18">
                    <ArrowDown />
                  </el-icon>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="result-font z_flex">
        <el-pagination background layout="prev, pager, next, sizes, total" :total="1000" />
      </div>
    </div>
  </div>
</template>
<script setup>
const router = useRouter();
const route = useRoute();
let checked1 = ref(false);
let formList = ref([
  {
    title: "国际分类",
    child: [
      {
        name: "01类 化学原料",
        check: false
      },
      {
        name: "02类 化学原料",
        check: false
      },
      {
        name: "01类 化学原料",
        check: false
      },
      {
        name: "02类 化学原料",
        check: false
      },
      {
        name: "01类 化学原料",
        check: false
      },
      {
        name: "02类 化学原料",
        check: false
      }
    ]
  },
  {
    title: "商品服务",
    place: "请选择商品/服务项，多商品项用逗号分离",
    value: ""
  },
  {
    title: "商标有效性",
    child: [
      {
        name: "有权",
        check: false
      },
      {
        name: "无权",
        check: false
      },
      {
        name: "审中",
        check: false
      },
      {
        name: "其他",
        check: false
      }
    ]
  }
]);

let routeList = ref([
  { title: "首页", url: "/home" },
  { title: "查商标", url: "/trademark/index" },
  { title: "商标检索" }
]);

let search = ref([
  { title: "综合搜索" },
  { title: "商标名称" },
  { title: "申请号" },
  { title: "申请人" }
]);
let searchIndex = ref(0);
let crad = ref([
  {
    title: "高级检索",
    tips: "智能在线高级检索"
  },
  {
    title: "图像检索",
    tips: "智能图像检索"
  }
]);
let cradIndex = ref(0);
const back = () => {
  router.go(-1);
};

const toPath = (e, url) => {
  let id = e.target.id;
  if (id === "back") {
    back();
    return;
  }
  if (!url) {
    return;
  }
  toUrl(url);
};

const toUrl = url => {
  router.push(url);
};
</script>
<style lang="scss" scoped>
::v-deep .el-checkbox__input.is-checked + .el-checkbox__label {
  color: #0052d9;
}
::v-deep .el-checkbox__input.is-checked .el-checkbox__inner {
  background-color: #0052d9;
  border-color: #0052d9;
}
.ellipsis {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pos1 {
  padding-bottom: 16px;
  &-title {
    font-size: 16px;
    font-family: PingFang SC, PingFang SC-Medium;
    font-weight: 500;
    text-align: left;
    color: #181818;
    line-height: 24px;
    padding-top: 16px;
    margin-bottom: 16px;
  }
  &-list {
    display: flex;
    margin-bottom: 20px;
    .views {
      width: 110px;
      height: 32px;
      padding: 0 5px;
      background: #f4f6fa;
      border-radius: 2px;
      margin-right: 20px;
      display: flex;
      align-items: center;
      img {
        margin-right: 5px;
      }
    }
    .views:last-of-type {
      margin-right: 0;
      background: rgba(255, 255, 255, 1);
    }
  }
}
.markr {
  padding: 0 240px;
  border-bottom: 20px solid #f5f7fa;
  .result {
    background: #ffffff;
    border: 2px solid #ffffff;
    border-radius: 4px;
    &-font {
      display: flex;
      align-items: center;
      padding-bottom: 30px;
    }
    &-list {
      .lists {
        padding: 30px;
        display: flex;
        background: #ffffff;
        cursor: pointer;
        &-right {
          flex: 1;
          margin-left: 20px;
          .conts {
            .open {
              display: flex;
              justify-content: flex-end;
              font-size: 14px;
              font-family: PingFang SC, PingFang SC-Regular;
              font-weight: 400;
              color: #0052d9;
              cursor: pointer;
            }
            .conts_flex {
              padding: 4px 0;
              display: flex;
              font-size: 14px;
              font-family: PingFang SC, PingFang SC-Regular;
              font-weight: 400;
              text-align: left;
              color: #575966;
              line-height: 22px;
              margin-right: 30px;
            }
          }
          .title {
            font-size: 16px;
            font-family: PingFang SC, PingFang SC-Semibold;
            font-weight: 600;
            text-align: left;
            color: #181818;
            line-height: 24px;
            display: flex;
            align-items: center;
            span {
              height: 18px;
              line-height: 18px;
              padding: 0 4px;
              background: rgba(0, 82, 217, 0.1);
              border-radius: 2px;
              font-size: 12px;
              font-family: PingFang SC, PingFang SC-Regular;
              font-weight: 400;
              color: #0052d9;
              margin-left: 6px;
            }
          }
        }
        .image {
          width: 150px;
          height: 100px;
          flex-shrink: 0;
          background: red;
        }
      }
    }
    &-select {
      height: 48px;
      margin: 0 30px;
      border-top: 1px solid #f5f7fa;
    }
    &-header {
      height: 70px;
      padding: 0 30px;
      display: flex;
      align-items: center;
      .btn {
        width: 104px;
        height: 36px;
        border: 1px solid #0052d9;
        border-radius: 2px;
        font-size: 14px;
        font-family: PingFang SC, PingFang SC-Regular;
        font-weight: 400;
        color: #0052d9;
        line-height: 36px;
        margin-left: 20px;
        cursor: pointer;
      }
      .num1 {
        font-size: 16px;
        font-family: PingFang SC, PingFang SC-Semibold;
        font-weight: 600;
        text-align: left;
        color: #202020;
        line-height: 20px;
      }
      .sort {
        font-size: 14px;
        font-family: PingFang SC, PingFang SC-Regular;
        font-weight: 400;
        text-align: right;
        color: #202020;
        cursor: pointer;
        line-height: 20px;
      }
      img {
        width: 20px;
        height: 20px;
        cursor: pointer;
      }
    }
  }
  .form {
    padding: 20px 20px 0;
    background: #ffffff;
    border: 2px solid #ffffff;
    border-radius: 4px;
    margin: 20px 0;
    &-more {
      padding-bottom: 20px;
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 14px;
      font-family: PingFang SC, PingFang SC-Regular;
      font-weight: 400;
      color: #0052d9;
      cursor: pointer;
    }
    &-div {
      display: flex;
      align-items: center;
      margin-bottom: 20px;
      .divs {
        display: flex;
        align-items: center;
      }
      .open {
        flex: 1;
        display: flex;
        justify-content: flex-end;
        align-items: center;
        font-size: 14px;
        font-family: PingFang SC, PingFang SC-Regular;
        font-weight: 400;
        color: #0052d9;
        cursor: pointer;
        position: relative;
        .pos1 {
          width: 300px;
          background: #ffffff;
          border-radius: 4px;
          box-shadow: 0px 5px 20px 0px rgba(0, 0, 0, 0.1);
          position: absolute;
          bottom: 30px;
          right: -22px;
          z-index: 999;
          padding: 0 20px;
        }
      }
      .t1 {
        font-size: 14px;
        font-family: PingFang SC, PingFang SC-Regular;
        font-weight: 400;
        text-align: left;
        color: #202020;
        line-height: 22px;
        width: 5em;
        margin-right: 46px;
      }
    }
  }
  &-cont {
    padding-top: 52px;
    .head {
      height: 247px;
      padding-left: 20px;
      background: url("../../assets/zhome/bg1.png") no-repeat;
      background-size: 100% 100%;
      display: flex;
      flex-direction: column;
      justify-content: center;
      position: relative;
      ::v-deep .el-input__wrapper {
        box-shadow: 0 0 0 1px transparent inset;
      }
      .mul {
        position: absolute;
        z-index: 8;
        top: 30px;
        right: 20px;
        display: flex;
        align-items: center;
        font-size: 14px;
        font-family: PingFang SC, PingFang SC-Regular;
        font-weight: Regular;
        text-align: right;
        color: #0052d9;
        cursor: pointer;
        img {
          width: 16px;
          height: 16px;
          margin-right: 6px;
        }
      }
      .crad {
        display: flex;
        padding-top: 16px;
        &-view {
          width: 220px;
          height: 72px;
          background: #ffffff;
          border-radius: 4px;
          display: flex;
          align-items: center;
          margin-right: 20px;
          cursor: pointer;
          position: relative;
          .pos {
            width: 56px;
            height: 20px;
            line-height: 20px;
            background: #ff4d00;
            border-radius: 8px 8px 8px 0px;
            font-size: 12px;
            font-family: PingFang SC, PingFang SC-Regular;
            font-weight: Regular;
            text-align: center;
            color: #ffffff;
            position: absolute;
            top: -10px;
            right: -10px;
          }
          .left {
            width: 186px;
            height: 72px;
            background: #ffffff;
            border-radius: 4px;
            display: flex;
            align-items: center;
            img {
              width: 68px;
              height: 68px;
            }
          }
          .right {
            display: flex;
            align-items: center;
            justify-content: center;
            flex: 1;
            img {
              width: 14px;
              height: 14px;
            }
          }

          .name {
            div {
              font-size: 12px;
              font-family: PingFang SC, PingFang SC-Regular;
              text-align: left;
              color: #646770;
              line-height: 17px;
            }
            div:first-of-type {
              font-size: 16px;
              font-family: PingFang SC, PingFang SC-Semibold;
              font-weight: 600;
              text-align: left;
              color: #202020;
              line-height: 22px;
              padding-bottom: 7px;
            }
          }
        }
        .select {
          background: #0052d9;
          .name {
            div {
              color: #0052d9;
            }
          }
        }
      }
      .ipt {
        width: 800px;
        height: 48px;
        background: #ffffff;
        border: 1px solid #1752d9;
        border-radius: 4px;
        display: flex;
        align-items: center;
        box-sizing: border-box;
        .h11 {
          font-size: 16px;
          font-family: PingFang SC, PingFang SC-Medium;
          font-weight: 500;
          color: #222426;
          padding-left: 18px;
          display: flex;
          align-items: center;
        }
        img {
          width: 12px;
          height: 12px;
          margin: 0 0 0 5px;
        }

        .btn {
          width: 120px;
          line-height: 48px;
          height: 100%;
          background: #0052d9;
          display: flex;
          align-items: center;
          justify-content: center;
          font-size: 16px;
          font-family: PingFang SC, PingFang SC-Medium;
          font-weight: 500;
          cursor: pointer;
          color: #ffffff;
        }
      }

      .saerch {
        display: flex;
        position: relative;
        padding: 0 0 16px;
        span {
          padding: 0 12px;
          cursor: pointer;
          font-size: 14px;
          font-family: PingFang SC, PingFang SC-Regular;
          font-weight: Regular;
          text-align: left;
          color: #202020;
          line-height: 20px;
          position: relative;
        }
        span::before {
          content: "";
          width: 1px;
          height: 14px;
          background: #202020;
          position: absolute;
          top: 50%;
          transform: translateY(-50%);
          right: 0;
        }
        span:first-of-type {
          padding-left: 0;
        }
        span:last-of-type::before {
          content: "";
          height: 14px;
          background: transparent;
          position: absolute;
          top: 50%;
          transform: translateY(-50%);
          right: 0;
        }
        .select-span {
          font-size: 14px;
          font-family: PingFang SC, PingFang SC-Semibold;
          font-weight: 600;
          color: #0052d9;
        }
      }
    }
  }
}

.header {
  width: calc(100% - 240px);
  height: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding-left: 240px;
  position: fixed;
  background-color: #f5f7fa;
  top: 110px;
  left: 0;
  z-index: 99999;
  .more {
    display: flex;
    align-items: center;
    padding-right: 240px;
    font-size: 14px;
    font-family: PingFang SC, PingFang SC-Regular;
    font-weight: Regular;
    color: #202020;
    line-height: 20px;
    cursor: pointer;
    img {
      margin-right: 2px;
    }
  }
}
.router {
  display: flex;
  flex: 1;

  .title {
    font-size: 12px;
    font-family: PingFang SC, PingFang SC-Regular;
    font-weight: 400;
    text-align: left;
    color: #575966;
  }
  .route {
    display: flex;
    align-items: center;
    .icon-right {
      width: 10px;
      height: 10px;
      margin: 0 10px;
    }
  }
  &-next {
    padding: 0 12px;
    height: 32px;
    background: #ffffff;
    border-radius: 2px;
    display: flex;
    align-items: center;
    cursor: pointer;
    .bor {
      width: 6px;
      height: 6px;
      background: #0052d9;
      border-radius: 3px;
      margin-right: 10px;
    }
    .gey {
      background: #575966;
    }
  }
  &-view {
    padding: 0 12px;
    height: 32px;
    background: #ffffff;
    border-radius: 2px;
    display: flex;
    align-items: center;
    cursor: pointer;
    .border {
      width: 1px;
      height: 10px;
      background: #d8d8d8;
      margin: 0 12px;
    }
    .title {
      margin-left: 10px;
    }
    .back {
      width: 14px;
      height: 14px;
    }
  }
}
</style>